<template>
  <client-only>
    <el-dropdown>
      <el-avatar src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png" />
      <template #dropdown>
        <el-dropdown-menu>
          <el-dropdown-item @click="logout">退出登录</el-dropdown-item>
        </el-dropdown-menu>
      </template>
    </el-dropdown>
  </client-only>
</template>

<script setup lang="ts">
  const router = useRouter()
  const logout = () => {
    removeItem()
    router.push('/login')
  }
</script>

<style scoped lang="less">
  .el-avatar {
    width: 100%;
    height: 3rem;
  }
</style>
